//
//  LoginManger.h
//  CNstorm
//
//  Created by 陈家将 on 2017/5/25.
//  Copyright © 2017年 chenjiajiang. All rights reserved.
//

#import <Foundation/Foundation.h>
@class RegisterReqModel;

typedef void(^LoginSuccess)(NSInteger code,NSString *email);
typedef void(^LoginFail)(NSString *errorMsg);

@interface LoginManger : NSObject

interfaceSingleton(LoginManger);// 单例声明

/** 普通用户名密码登录 */
- (void)loginWithName:(NSString *)name password:(NSString *)password success:(LoginSuccess)successBlock fail:(LoginFail)failBlock;

/** 用户注册 */
- (void)registerWithInfo:(RegisterReqModel *)model success:(LoginSuccess)successBlock fail:(LoginFail)failBlock;

/** 重置密码 */
- (void)resetPasswordWithEamil:(NSString *)email success:(LoginSuccess)successBlock fail:(LoginFail)failBlock;

/** 第三方授权登录 */
- (void)OauthLoginWithInfo:(RegisterReqModel *)model success:(LoginSuccess)successBlock fail:(LoginFail)failBlock;

/** 退出登录 */
- (void)loginOutSuccess:(LoginSuccess)successBlock fail:(LoginFail)failBlock;

- (void)loginAgain;

@end
